
{% from "Makefile.common.jinja" import src_build_dir with context %}

{% set sketches = e.src_dir|glob('*.pde', '*.ino')|filemap(src_build_dir, e.names.cpp) %}
{% for source, target in sketches.iterpaths() %}
{{ target }} : {{ source }}
	@mkdir -p {{ target|dirname }}
	@echo {{ source|colorize('yellow') }}
	{{v}}{{ e.ino }} preproc {% if 'arduino_dist_dir' in e %}-d {{ e['arduino_dist_dir'] }}{% endif %} -o $@ $^
{% endfor %}

all : {{ sketches.target_paths() }}
	@true

{#
vim:noexpandtab filetype=jinja
#}
